{% extends "base.html" %}
{% load wagtailcore_tags wagtailimages_tags %}
 
{% block content %}

    <div class="pageContainer line linear">
				<div class="container">
					<!-- 常见问题 -->
                    {% if request.GET.tag|length %}
                        <div class="textBox">
                            <h2 class="title">Showing pages tagged "{{ request.GET.tag }}"</h2>
                        </div>      
                    {% endif %}
					

					<div id="caseGroup">
						<div class="richImgGroup caseItem"> <!-- <div class="richImgGroup caseItem" style="display:none"> -->
							<div class="itemWrapper space">

								{% for post in blogpages %}
                                        <div class="item">
                                            <a href="{% pageurl post %}" class="spaceWrap" target="_blank">
                                                <div class="topImg">
                                                    {% image post.cover fill-412x240 class="articleThumb" id="cover" %}
                                                </div>
                                                <div class="midBox">
                                                    <div class="top">{{ post.date }}<span class="ml5 mr5">·</span>浏览数：{{ post.total_views }}</div>
                                                        <h3>{{ post.title }}</h3>
                                                        <p class="detail">{{ post.intro }}</p>
                                                    <div class="more">Load More</div>
                                                    <small>Revised: {{ post.latest_revision_created_at }}</small><br />
                                                </div>
                                            </a>
                                        </div>
                                
                                {% if post.author %}
                                    <p>By {{ post.author.profile }}</p>
                                {% endif %}
								{% empty %}
                                    No pages found with that tag.
                                {% endfor %}
							</div>

                        <!--分页功能-->
                            <div class="loadmoreWrap">
								<div id="pageGroup">

                                    {% if blogpages.has_previous %}
                                    <a href="?page={{ blogpages.previous_page_number }}" class="homepage">&laquo;</a>
                                    {% endif %}

                                    {% for page_num in blogpages.paginator.page_range %}
                                        {% comment %} <a href="http://120.24.145.83/case/" class="listpage curpage">1</a> {% endcomment %}
                                        <a {% if page_num == blogpages.number %} class="listpage curpage" {% else %}  class="listpage" {% endif %} href="?page={{ page_num }}" >{{ page_num }}</a>

                                    {% endfor %}


                                    {% if blogpages.has_next %}
                                    <a href="?page={{ blogpages.next_page_number }}" class="nextpage">&raquo;</a>
                                    {% endif %}
                                </div>
							</div>
                            
                        </div>
                    </div>
                </div>
            </div>     
 
{% endblock %}